program main
    implicit none
    integer::a(10)
    integer::b(10)
    integer,allocatable::c(:)
    integer::i,j,k=1!! k=1 ,j=1
    b=-999
    a=[1,3,5,7,9,1,2,3,4,5]
    write(*,*)"remove duplicate"
    write(*,*)a
    b(1)=a(1)
    write(*,*)"method 1"
    do i=2,10
        if(all(b(1:k)/=a(i)))then
            b(k+1)=a(i)
            k=k+1
        end if
    end do
    write(*,*)b(1:k)
    write(*,*)"method 2"
    c=a
    j=c(1)
    do
        c=[pack(c,c/=c(1)),c(1)]
        if(j==c(1))exit
    end do
    write(*,*)c
end program main
